package com.sacc.controller;

import com.google.gson.Gson;
import com.power.common.model.CommonResult;
import com.sacc.pojo.BoxAll;
import com.sacc.pojo.BoxInfo;
import com.sacc.pojo.ProductInfoAll;
import com.sacc.service.BoxAllService;
import com.sacc.service.BoxInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.List;

/**
 * @author 滚~韬
 * @date 2022/4/12 17:29
 */
@RestController
@RequestMapping("/box/list")
public class BoxInfoController {
    @Autowired
    private BoxAllService boxAllService;
    @Autowired
    private BoxInfoService boxInfoService;
    /**
     * 获取蜂箱列表
     * @return
     */
    @GetMapping("/get")
    public List<BoxAll> getList(){
        return boxAllService.getAll();
    }

    /**
     * 添加一个boxinfo
     * @param boxInfo
     * @return
     */
    @PostMapping("/add")
    public CommonResult addOneList(@RequestBody BoxInfo boxInfo){
        return boxInfoService.Add(boxInfo);
    }
}
